package com.orm.handler;

import java.sql.*;
import java.time.LocalDate;

/**
 * java.sql.Date
 */
public class SqlDateTypeHandler extends BaseTypeHandler<Date>{
	
	@Override
	public void setNotNullParameter(PreparedStatement ps, int i, Date parameter, JDBCType jdbcType) throws SQLException {
		ps.setDate(i, parameter);
	}
	
	@Override
	public Date getNullableResult(ResultSet rs, String columnName) throws SQLException {
		return rs.getDate(columnName);
	}
	
	@Override
	public Date getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
		return rs.getDate(columnIndex);
	}
}
